#!/bin/bash
t=0
for i in `seq 1 40`
	do x=`wget -t 3 -w 3 -T 3 -q http://uoladmin:sun123@a4-vitoria$i.host.intranet:8086/connectioncounts -O - |awk -F\> '{print $3}' |awk -F\< '{print $1}'`
	x=`echo -n $x`
	#echo  "vitoria$i:$x"
	let t+=$x
done


##date time vitoria_1  vitoria_2  vitoria_3  vitoria_4  vitoria_5  vitoria_6  vitoria_7  vitoria_8  vitoria_9  vitoria_10
#06/02/2009 09:16:49 16  6  15  5  14  4  17  3  14  4

data=`date "+%d/%m/%Y %H:%M:%S"`

echo "$data $t" >> /export/htdocs/alta.portal.intranet/audiencias/online/online.dat
/export/htdocs/alta.portal.intranet/audiencias/online/total.pg > /export/htdocs/alta.portal.intranet/audiencias/online/total.png

echo "
<html>
<body>
<img src="total.png" align="left" >
<br>
Data: $data	Usuarios:$t
</body>
</html>
" > /export/htdocs/alta.portal.intranet/audiencias/online/index.html

